def outer():
    a = 1

    def inner():
        print("我是inner函数", a)

    return inner


import time


def showtime(func):
    def wrapper(*args, **kwargs):
        start_time = time.time()
        func(*args, **kwargs)
        end_time = time.time()
        print('spend is {}'.format(end_time - start_time))

    return wrapper


@showtime
def foo(a, b):
    print('foo..')
    print(a + b)
    time.sleep(3)


@showtime
def eat(a):
    print(a ** 3)


# foo = showtime(foo)
foo(1, 2)
eat(a=2)
